#ifndef tlmServiceDataInfo_H
#define tlmServiceDataInfo_H

#include "tlmService.h"
#include "tlmServiceApp.h"
//## attribute mDataInfoBuffer
#include "msgbuf.h"



//## operation SetItsService(tlmServiceApp)
class tlmServiceApp;

//## class tlmServiceDataInfo
class tlmServiceDataInfo {
    ////    Friends    ////
    
public :


    ////    Constructors and destructors    ////
    
    //## operation tlmServiceDataInfo(uint8_t*,uint32_t)
    tlmServiceDataInfo(uint8_t* bufPtr, uint32_t size);
    
    //## operation tlmServiceDataInfo()
    tlmServiceDataInfo();
    
    //## auto_generated
    virtual ~tlmServiceDataInfo();
    
    ////    Operations    ////
    
    //## operation Fill()
    virtual void Fill();
    
    // get the length of data info, which should include the first escape byte 0x7E.
    //## operation GetDataInfoSize() const
    uint32_t GetDataInfoSize() const;
    
    // This function return the max data info size, it's used to allocate enough memory
    //## operation GetMaxDataInfoSize()
    virtual uint32_t GetMaxDataInfoSize();
    
    
    // Init is use current service's setting to initialize the components
    // This is always used by out message
    //## operation Init()
    virtual void Init();
    
    // ParseInit is used to parse the incoming message and initialize dataiofo components.
    //## operation ParseInit()
    virtual bool_t ParseInit();
    
    //## operation SetDataInfoBuf(uint8_t*,uint32_t)
    void SetDataInfoBuf(uint8_t* bufPtr, uint32_t size);
    
    // This function translates escape byte to actual byte
    //## operation TranslateData(uint8_t)
    uint8_t TranslateData(uint8_t data);

	//## operation SetItsService(tlmServiceApp)
    void SetItsService(tlmServiceApp* srv);
    
    ////    Additional operations    ////
    
protected :

    msgbuf mDataInfoBuffer;		//## attribute mDataInfoBuffer
    
    // this is the actual data info size, includs the first escape byte 0x7E
    uint32_t mDataInfoSize;		//## attribute mDataInfoSize
    
    tlmServiceApp * mItsService;		//## attribute mItsService
};
#endif
